package com.lwq.imserver.model;

import com.lwq.imserver.model.system.SysUser;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Description:
 * Author: LiuWenQing
 * Datetime: 2022/1/26 13:19
 */
@Data
@Document(collection = "chat_message")
public class ChatMessage implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    private String id;

    private String uuid;

    private String content;

    /**
     * 发送人ID
     */
    private String from;

    private String fromName;

    private String fromAvatar;

    private String fromSex;
    /**
     * 消息父级ID
     */
    private String parentId;

    /**
     * 顶级ID,自己是顶级则为空
     */
    private String topId;

    /**
     * 1单发 2群发
     */
    private Integer single;

    private Long timestamp;

    private String roomId;

    private List<ChatMessage> replyMessages = new ArrayList<>();

    private List<ChatMessageFile> attachments = new ArrayList<>();

    private List<SysUser> friends;

}
